package com.wcy.feign.user;

import com.wcy.util.vo.FileAttribute;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.multipart.MultipartFile;

@FeignClient(name = "cloud-provider-user",contextId = "userFileController")
public interface FeignUserFileController {
    @PostMapping(value="file/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public FileAttribute upload(MultipartFile file) ;

    @GetMapping("file/download/{convertedFileName}")
    public ResponseEntity<byte[]> download(@PathVariable("convertedFileName") String convertedFileName) ;
}
